﻿using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Abp.Modules;
using Abp.Reflection.Extensions;
using DualControl.Configuration;


using DualControl.Quartz;
using Abp.Quartz;

namespace DualControl.Web.Startup
{
    [DependsOn(typeof(DualControlWebCoreModule)
        ,typeof(AbpQuartzModule))]   
    public class DualControlWebMvcModule : AbpModule
    {
        private readonly IHostingEnvironment _env;
        private readonly IConfigurationRoot _appConfiguration;       

        public DualControlWebMvcModule(IHostingEnvironment env
                   
            )
        {
            _env = env;
            _appConfiguration = env.GetAppConfiguration();
         
        }

        public override void PreInitialize()
        {
            //关闭审计日志
            Configuration.Auditing.IsEnabled = false;

            Configuration.Navigation.Providers.Add<DualControlNavigationProvider>();
        }

        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(typeof(DualControlWebMvcModule).GetAssembly());
        }
    }
}
